package com.xd.service.admin.XTGLY.impl;

import com.xd.Dto.ProductPageQueryDTO;
import com.xd.Mapper.ProductMapper;
import com.xd.Result.PageResult;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.xd.service.admin.XTGLY.AdminGetProductInfor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminGetProductInforImpl implements AdminGetProductInfor {
    @Autowired
    ProductMapper productMapper;
    @Override
    public PageResult getProduct(ProductPageQueryDTO pageQueryDTO) {
        PageHelper.startPage(pageQueryDTO.getPage(),pageQueryDTO.getPageSize());
        Page page =productMapper.pageHelper(pageQueryDTO);
        return new PageResult(page.getTotal(),page.getResult());

    }
}




